package com.situ.user.controller;

import com.situ.user.pojo.User;
import com.situ.user.service.IUserService;
import com.situ.user.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    private IUserService userService;

    @GetMapping("/user/{id}")
    public JSONResult selectById(@PathVariable("id") Long id)  {
        System.out.println("id: " + id);

        User user = userService.selectById(id);
        // return JSONResult.ok(user);
        return JSONResult.ok(user);
    }

}
